This code auto-scrolls level (or background) layer 2 up or down relative to layer 1, which makes rising and falling layer 2 sections possible without taking away vertical camera freedom.
A couple notes:
-Lunar Magic 3.40+ can already autoscroll layer 2. However, you only get 12 options, while this gives you far more customization for how fast layer 2 moves.
-It must be assured that the player can never reach layer 2 scrolled past the area that has been placed in Lunar Magic, or glitchy tiles will appear. This works for the applications shown in the screenshots, as the layer 2 itself impedes the player from going further down (for the lava) or up (for the blocks). For rising layer 2, it is of interest to also account for Mario's death animation, as he falls down a fair amount when dying (the .asm file talks about this in more detail).
yoshifanatic's Update:
- Fixed the faulty no Yoshi intro check so pipe entrances don't break this UberASM.
- Made some minor optimizations.
- Made this disable vertical layer 2 scroll during level init as a convenience.
- Added functionality to customize how many subpixels layer 2 moves to allow for more precision.